<template>
  <a-card :bordered="false">

    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

          <a-col :md="6" :sm="8">
            <a-form-item label="riserate">
              <a-input placeholder="请输入riserate" v-model="queryParam.riserate"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="resaMoneyPrecision">
              <a-input placeholder="请输入resaMoneyPrecision" v-model="queryParam.resaMoneyPrecision"></a-input>
            </a-form-item>
          </a-col>
        <template v-if="toggleSearchStatus">
        <a-col :md="6" :sm="8">
            <a-form-item label="lotManagerMode">
              <a-input placeholder="请输入lotManagerMode" v-model="queryParam.lotManagerMode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="lotModify">
              <a-input placeholder="请输入lotModify" v-model="queryParam.lotModify"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="maxsalesqty">
              <a-input placeholder="请输入maxsalesqty" v-model="queryParam.maxsalesqty"></a-input>
            </a-form-item>
          </a-col>
          </template>
          <a-col :md="6" :sm="8" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('销售中心')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <retailCenter-modal ref="modalForm" @ok="modalFormOk"></retailCenter-modal>
  </a-card>
</template>

<script>
  import RetailCenterModal from './modules/RetailCenterModal'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'

  export default {
    name: "RetailCenterList",
    mixins:[JeecgListMixin],
    components: {
      RetailCenterModal
    },
    data () {
      return {
        description: '销售中心管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
           },
		   {
            title: 'riserate',
            align:"center",
            dataIndex: 'riserate'
           },
		   {
            title: 'resaMoneyPrecision',
            align:"center",
            dataIndex: 'resaMoneyPrecision'
           },
		   {
            title: 'lotManagerMode',
            align:"center",
            dataIndex: 'lotManagerMode'
           },
		   {
            title: 'lotModify',
            align:"center",
            dataIndex: 'lotModify'
           },
		   {
            title: 'maxsalesqty',
            align:"center",
            dataIndex: 'maxsalesqty'
           },
		   {
            title: 'updatepos',
            align:"center",
            dataIndex: 'updatepos'
           },
		   {
            title: 'inputmethod',
            align:"center",
            dataIndex: 'inputmethod'
           },
		   {
            title: 'salerflag',
            align:"center",
            dataIndex: 'salerflag'
           },
		   {
            title: 'workingtype',
            align:"center",
            dataIndex: 'workingtype'
           },
		   {
            title: 'ctrllowprice',
            align:"center",
            dataIndex: 'ctrllowprice'
           },
		   {
            title: 'dispaygathmoney',
            align:"center",
            dataIndex: 'dispaygathmoney'
           },
		   {
            title: 'retailcenterid',
            align:"center",
            dataIndex: 'retailcenterid'
           },
		   {
            title: 'entryid',
            align:"center",
            dataIndex: 'entryid'
           },
		   {
            title: 'presstockflag',
            align:"center",
            dataIndex: 'presstockflag'
           },
		   {
            title: 'printflag',
            align:"center",
            dataIndex: 'printflag'
           },
		   {
            title: 'reqsplitflag',
            align:"center",
            dataIndex: 'reqsplitflag'
           },
		   {
            title: 'iscomm',
            align:"center",
            dataIndex: 'iscomm'
           },
		   {
            title: 'reqcenterst',
            align:"center",
            dataIndex: 'reqcenterst'
           },
		   {
            title: 'reqqtyuplimit',
            align:"center",
            dataIndex: 'reqqtyuplimit'
           },
		   {
            title: 'manualratelimit',
            align:"center",
            dataIndex: 'manualratelimit'
           },
		   {
            title: 'miniaturetaxpayerflag',
            align:"center",
            dataIndex: 'miniaturetaxpayerflag'
           },
		   {
            title: 'incometaxrate',
            align:"center",
            dataIndex: 'incometaxrate'
           },
		   {
            title: 'outputtaxrate',
            align:"center",
            dataIndex: 'outputtaxrate'
           },
		   {
            title: 'placepointtype',
            align:"center",
            dataIndex: 'placepointtype'
           },
		   {
            title: 'batchManagerMode',
            align:"center",
            dataIndex: 'batchManagerMode'
           },
		   {
            title: 'insautoup',
            align:"center",
            dataIndex: 'insautoup'
           },
		   {
            title: 'otcrestrict',
            align:"center",
            dataIndex: 'otcrestrict'
           },
		   {
            title: 'defaultdocter',
            align:"center",
            dataIndex: 'defaultdocter'
           },
		   {
            title: 'defaulthospital',
            align:"center",
            dataIndex: 'defaulthospital'
           },
		   {
            title: 'maxephqty',
            align:"center",
            dataIndex: 'maxephqty'
           },
		   {
            title: 'exampriceid',
            align:"center",
            dataIndex: 'exampriceid'
           },
		   {
            title: 'prelotmanagermode',
            align:"center",
            dataIndex: 'prelotmanagermode'
           },
		   {
            title: 'peifangmanid',
            align:"center",
            dataIndex: 'peifangmanid'
           },
		   {
            title: 'shenfangmanid',
            align:"center",
            dataIndex: 'shenfangmanid'
           },
		   {
            title: 'translineid',
            align:"center",
            dataIndex: 'translineid'
           },
		   {
            title: 'sadaysParam',
            align:"center",
            dataIndex: 'sadaysParam'
           },
		   {
            title: 'topnumParam',
            align:"center",
            dataIndex: 'topnumParam'
           },
		   {
            title: 'categoryid',
            align:"center",
            dataIndex: 'categoryid'
           },
		   {
            title: 'bulkcheckmanid',
            align:"center",
            dataIndex: 'bulkcheckmanid'
           },
		   {
            title: 'deliveryday',
            align:"center",
            dataIndex: 'deliveryday'
           },
		   {
            title: 'totalarea',
            align:"center",
            dataIndex: 'totalarea'
           },
		   {
            title: 'livingarea',
            align:"center",
            dataIndex: 'livingarea'
           },
		   {
            title: 'recipereusableflag',
            align:"center",
            dataIndex: 'recipereusableflag'
           },
		   {
            title: 'manuallyadd',
            align:"center",
            dataIndex: 'manuallyadd'
           },
		   {
            title: 'isapproval',
            align:"center",
            dataIndex: 'isapproval'
           },
		   {
            title: 'jfdkxs',
            align:"center",
            dataIndex: 'jfdkxs'
           },
		   {
            title: 'isconfirm',
            align:"center",
            dataIndex: 'isconfirm'
           },
		   {
            title: 'insiderchangelow',
            align:"center",
            dataIndex: 'insiderchangelow'
           },
		   {
            title: 'officesids',
            align:"center",
            dataIndex: 'officesids'
           },
		   {
            title: 'officesnames',
            align:"center",
            dataIndex: 'officesnames'
           },
		   {
            title: 'classtempletid',
            align:"center",
            dataIndex: 'classtempletid'
           },
		   {
            title: 'iszfb',
            align:"center",
            dataIndex: 'iszfb'
           },
		   {
            title: 'zfbPayPubkey',
            align:"center",
            dataIndex: 'zfbPayPubkey'
           },
		   {
            title: 'zfbPrivatekey',
            align:"center",
            dataIndex: 'zfbPrivatekey'
           },
		   {
            title: 'zfbAppid',
            align:"center",
            dataIndex: 'zfbAppid'
           },
		   {
            title: 'isweixin',
            align:"center",
            dataIndex: 'isweixin'
           },
		   {
            title: 'wxCustomerno',
            align:"center",
            dataIndex: 'wxCustomerno'
           },
		   {
            title: 'isendofday',
            align:"center",
            dataIndex: 'isendofday'
           },
		   {
            title: 'issame',
            align:"center",
            dataIndex: 'issame'
           },
		   {
            title: 'avgmathed',
            align:"center",
            dataIndex: 'avgmathed'
           },
		   {
            title: 'avgmathedpoint',
            align:"center",
            dataIndex: 'avgmathedpoint'
           },
		   {
            title: 'updownupdate',
            align:"center",
            dataIndex: 'updownupdate'
           },
		   {
            title: 'updowngoods',
            align:"center",
            dataIndex: 'updowngoods'
           },
		   {
            title: 'updownavgmathed',
            align:"center",
            dataIndex: 'updownavgmathed'
           },
		   {
            title: 'updownmathedpoint',
            align:"center",
            dataIndex: 'updownmathedpoint'
           },
		   {
            title: 'defaultupdays',
            align:"center",
            dataIndex: 'defaultupdays'
           },
		   {
            title: 'defaultdowndays',
            align:"center",
            dataIndex: 'defaultdowndays'
           },
		   {
            title: 'avgcalculatemathed',
            align:"center",
            dataIndex: 'avgcalculatemathed'
           },
		   {
            title: 'd1days',
            align:"center",
            dataIndex: 'd1days'
           },
		   {
            title: 'd2days',
            align:"center",
            dataIndex: 'd2days'
           },
		   {
            title: 'd3days',
            align:"center",
            dataIndex: 'd3days'
           },
		   {
            title: 'd4days',
            align:"center",
            dataIndex: 'd4days'
           },
		   {
            title: 'd1proportion',
            align:"center",
            dataIndex: 'd1proportion'
           },
		   {
            title: 'd2proportion',
            align:"center",
            dataIndex: 'd2proportion'
           },
		   {
            title: 'd3proportion',
            align:"center",
            dataIndex: 'd3proportion'
           },
		   {
            title: 'd4proportion',
            align:"center",
            dataIndex: 'd4proportion'
           },
		   {
            title: 'removenosale',
            align:"center",
            dataIndex: 'removenosale'
           },
		   {
            title: 'removeplace',
            align:"center",
            dataIndex: 'removeplace'
           },
		   {
            title: 'removenoaccept',
            align:"center",
            dataIndex: 'removenoaccept'
           },
		   {
            title: 'removeinst',
            align:"center",
            dataIndex: 'removeinst'
           },
		   {
            title: 'removeoutst',
            align:"center",
            dataIndex: 'removeoutst'
           },
		   {
            title: 'reqmathed',
            align:"center",
            dataIndex: 'reqmathed'
           },
		   {
            title: 'autoreqmathed',
            align:"center",
            dataIndex: 'autoreqmathed'
           },
		   {
            title: 'autoreqdate',
            align:"center",
            dataIndex: 'autoreqdate'
           },
		   {
            title: 'autorequsestatus',
            align:"center",
            dataIndex: 'autorequsestatus'
           },
		   {
            title: 'clacdaten',
            align:"center",
            dataIndex: 'clacdaten'
           },
		   {
            title: 'calcmethod',
            align:"center",
            dataIndex: 'calcmethod'
           },
		   {
            title: 'zxOtcflag0',
            align:"center",
            dataIndex: 'zxOtcflag0'
           },
		   {
            title: 'zxOtcflag1',
            align:"center",
            dataIndex: 'zxOtcflag1'
           },
		   {
            title: 'zxOtcflag2',
            align:"center",
            dataIndex: 'zxOtcflag2'
           },
		   {
            title: 'zxOtcflag3',
            align:"center",
            dataIndex: 'zxOtcflag3'
           },
		   {
            title: 'placepointid',
            align:"center",
            dataIndex: 'placepointid'
           },
		   {
            title: 'placepointopcode',
            align:"center",
            dataIndex: 'placepointopcode'
           },
		   {
            title: 'placepointno',
            align:"center",
            dataIndex: 'placepointno'
           },
		   {
            title: 'placepointname',
            align:"center",
            dataIndex: 'placepointname'
           },
		   {
            title: 'placepointpinyin',
            align:"center",
            dataIndex: 'placepointpinyin'
           },
		   {
            title: 'usestatus',
            align:"center",
            dataIndex: 'usestatus'
           },
		   {
            title: 'memo',
            align:"center",
            dataIndex: 'memo'
           },
		   {
            title: 'storageid',
            align:"center",
            dataIndex: 'storageid'
           },
		   {
            title: 'sthouseid',
            align:"center",
            dataIndex: 'sthouseid'
           },
		   {
            title: 'tel',
            align:"center",
            dataIndex: 'tel'
           },
		   {
            title: 'ones',
            align:"center",
            dataIndex: 'ones'
           },
		   {
            title: 'businesstime',
            align:"center",
            dataIndex: 'businesstime'
           },
		   {
            title: 'address',
            align:"center",
            dataIndex: 'address'
           },
		   {
            title: 'credate',
            align:"center",
            dataIndex: 'credate'
           },
		   {
            title: 'inputmanid',
            align:"center",
            dataIndex: 'inputmanid'
           },
		   {
            title: 'areadocid',
            align:"center",
            dataIndex: 'areadocid'
           },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
		url: {
          list: "/sa/retailCenter/list",
          delete: "/sa/retailCenter/delete",
          deleteBatch: "/sa/retailCenter/deleteBatch",
          exportXlsUrl: "sa/retailCenter/exportXls",
          importExcelUrl: "sa/retailCenter/importExcel",
       },
    }
  },
  computed: {
    importExcelUrl: function(){
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
    methods: {
     
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>